class Property(SimObject) :
	
	def __init__(self) :
		self.PurchaseMonth = Simulation.CurrentMonth
		self.Tenant = Tenant()
		self.TaxYearly = 0
		self.TaxCostMonthly = Simulation.InitializeList()
		self.InsuranceYearly = 0
		self.InsuranceCostMonthly = Simulation.InitializeList()
		self.MaintenanceYearly = 0
		self.MaintenanceCostMonthly = Simulation.InitializeList()
		self.HoaYearly = 0
		self.HoaCostMonthly = Simulation.InitializeList()

		self.Income = Simulation.InitializeList()
		self.Expenses = Simulation.InitializeList()
		self.NetIncome = Simulation.InitializeList()

		return self

	def Update(self) :
		m = Simulation.CurrentMonth
		if m == self.PurchaseMonth:
			return
		if (m-self.PurchaseMonth) % 12 == 0:
			self.TaxYearly = (1+Economy.InflationRateYearly)*self.TaxYearly
			self.InsuranceYearly = (1+Economy.InflationRateYearly)*self.InsuranceYearly
			self.MaintenanceYearly = (1+Economy.InflationRateYearly)*self.MaintenanceYearly
			self.HoaYearly = (1+Economy.InflationRateYearly)*self.HoaYearly
				
		self.TaxCostMonthly[m] = self.TaxYearly / 12.0
		self.InsuranceCostMonthly[m] = self.InsuranceYearly / 12.0
		self.MaintenanceCostMonthly[m] = self.MaintenanceYearly / 12.0
		self.HoaCostMonthly[m] = self.HoaYearly / 12.0
		
		self.Expenses[m] = self.TaxCostMonthly[m] + self.InsuranceCostMonthly[m] + self.MaintenanceCostMonthly[m] + self.HoaCostMonthly[m]

		self.Tenant.Update()
		self.Income[m] = self.Tenant.Rent[m]


	def vacant = IsVacant(self) :
		self.Tenant.Vacant
	
	def Vacate(self) :
		self.Tenant.Vacant = 1
		self.Tenant.Rent[Simulation.CurrentMonth] = 0

	def AddTenant(self, rent) :
		self.Tenant.Vacant = 0
		self.Tenant.Rent[Simulation.CurrentMonth] = rent
		self.Tenant.StartMonth = Simulation.CurrentMonth
